<template>
<div class="home">
  <div class="recommend">
    <div class="title">热销推荐</div>
    <ul>
      <router-link  tag="li" class="item" v-for="(item) in recommendList" :key="item.id" :to="'/detail/'+item.id">
        <img class="item-img"
          :src=item.imgUrl
          alt=""
        />
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
          <button class="btn">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
  </div>
</template>

<script>
export default {
  name: 'homeRecommend',
  data () {
    return {
      recomListInit: [{
        id: '001',
        imgUrl: 'http://img1.qunarzz.com/sight/p0/1503/55/5577ab22b2e205d0.water.jpg_200x200_069b3bd4.jpg',
        desc: '感受荷兰郁金香的异域风情',
        title: '东西湖郁金香主题公园'
      }, {
        id: '002',
        imgUrl: 'http://img1.qunarzz.com/sight/p0/1503/55/5577ab22b2e205d0.water.jpg_200x200_069b3bd4.jpg',
        desc: '感受荷兰郁金香的异域风情',
        title: '东西湖郁金香主题公园'
      }, {
        id: '003',
        imgUrl: 'http://img1.qunarzz.com/sight/p0/1503/55/5577ab22b2e205d0.water.jpg_200x200_069b3bd4.jpg',
        desc: '感受荷兰郁金香的异域风情',
        title: '东西湖郁金香主题公园'
      }, {
        id: '004',
        imgUrl: 'http://img1.qunarzz.com/sight/p0/1503/55/5577ab22b2e205d0.water.jpg_200x200_069b3bd4.jpg',
        desc: '感受荷兰郁金香的异域风情',
        title: '东西湖郁金香主题公园'
      }, {
        id: '005',
        imgUrl: 'http://img1.qunarzz.com/sight/p0/1503/55/5577ab22b2e205d0.water.jpg_200x200_069b3bd4.jpg',
        desc: '感受荷兰郁金香的异域风情',
        title: '东西湖郁金香主题公园'
      }]
    }
  },
  props: {
    recommendList: Array
  }
}
</script>

<style lang="scss">
@import '~@/assets/css/vertauls.scss';
.recommend {
  .title {
    line-height: 50px;
    background-color: #eee;
    text-indent: 15px;
    margin-top: 10px;
    font-size: 24px;
  }
  ul {
    .item {
      display: flex;
      overflow: hidden;
      height: 188px;
      .item-img {
        height: 180px;
        width: 180px;
        padding: 20px;
      }
      .item-info {
        flex: 1;
        padding: 20px 5px;
        min-width: 0;
        .item-title{
            line-height: 50px;
            font-size: 30px;
            @include ellip
        }
        .item-desc{
            line-height: 40px;
            font-size: 24px;
            color: #ccc;
            @include ellip
        }
        .btn {
            background-color: #ff9300;
            border-radius: 5px;
            font-size: 20px;
            margin-top: 20px;
            padding:0 15px;
            color: #fff;
        }
      }
    }
  }
}
</style>
